package com.tancire.net.service.impl;

import java.util.List;
import javax.annotation.Resource;

import com.tancire.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.tancire.net.mapper.NetUserActivityMapper;
import com.tancire.net.domain.NetUserActivity;
import com.tancire.net.service.INetUserActivityService;

/**
 * 会员活动量Service业务层处理
 *
 * @author chenchao
 * @date 2023-11-20
 */
@Service
public class NetUserActivityServiceImpl implements INetUserActivityService {
    @Resource
    private NetUserActivityMapper netUserActivityMapper;

    /**
     * 查询会员活动量
     *
     * @param id 会员活动量主键
     * @return 会员活动量
     */
    @Override
    public NetUserActivity selectNetUserActivityById(Long id) {
        return netUserActivityMapper.selectNetUserActivityById(id);
    }

    /**
     * 查询会员活动量列表
     *
     * @param netUserActivity 会员活动量
     * @return 会员活动量
     */
    @Override
    public List<NetUserActivity> selectNetUserActivityList(NetUserActivity netUserActivity) {
        return netUserActivityMapper.selectNetUserActivityList(netUserActivity);
    }

    /**
     * 新增会员活动量
     *
     * @param netUserActivity 会员活动量
     * @return 结果
     */
    @Override
    public int insertNetUserActivity(NetUserActivity netUserActivity) {
        netUserActivity.setCreateTime(DateUtils.getNowDate());
        return netUserActivityMapper.insertNetUserActivity(netUserActivity);
    }

    /**
     * 修改会员活动量
     *
     * @param netUserActivity 会员活动量
     * @return 结果
     */
    @Override
    public int updateNetUserActivity(NetUserActivity netUserActivity) {
        netUserActivity.setUpdateTime(DateUtils.getNowDate());
        return netUserActivityMapper.updateNetUserActivity(netUserActivity);
    }

    /**
     * 批量删除会员活动量
     *
     * @param ids 需要删除的会员活动量主键
     * @return 结果
     */
    @Override
    public int deleteNetUserActivityByIds(Long[] ids) {
        return netUserActivityMapper.deleteNetUserActivityByIds(ids);
    }

    /**
     * 删除会员活动量信息
     *
     * @param id 会员活动量主键
     * @return 结果
     */
    @Override
    public int deleteNetUserActivityById(Long id) {
        return netUserActivityMapper.deleteNetUserActivityById(id);
    }
}
